package com.zeekr.bean;

import lombok.Data;

/**
 * @description:
 * @author: e-Yuanping.Yang1
 * @time: 2024/6/19 16:04
 */
@Data
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;
    /**成功且带数据**/
    public static Result success(Object data){
        Result result = new Result();
        result.setCode(000000);
        result.setMsg("操作成功");
        result.setData(data);
        return result;
    }
    /**成功但不带数据**/
    public static Result success(){

        return success(null);
    }
    /**失败**/
    public static Result error(Integer code,String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

}
